package cn.software.controller;

import cn.software.anntation.LogAnnotation;
import cn.software.entity.param.PaperParam;
import cn.software.service.PaperService;
import cn.software.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/paper")
public class PaperController {
    @Autowired
    private PaperService paperService;


    @PostMapping("/uploadPaper")
    @LogAnnotation(moudle = "试卷", operator = "上传试卷")
    public Result uploadPaper(@RequestBody PaperParam paperParam) {
        boolean isSuccess = paperService.uploadPaper(paperParam);
        if(isSuccess) {
            return Result.success(null);
        } else {
            return Result.fail("失败");
        }
    }
}
